const {defineConfig} = require('@vue/cli-service')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = defineConfig({
    transpileDependencies: true,
    publicPath: './',
    devServer: {
        open: true,
        // host:'127.0.0.1',
        // proxy:{
        //   '/api':{
        //     logLevel: 'debug',
        //     // logProvider:()=>console,
        //     target: '#',
        //   },
        // },
        client: {
            overlay: false// 编译错误时，取消全屏覆盖（建议关掉）
        }
    },
    configureWebpack:{
        optimization: {
            minimizer: [
                new UglifyJsPlugin({
                    uglifyOptions: {
                        // 删除注释
                        output: {
                            comments: false
                        },
                        // 删除console debugger 删除警告
                        compress: {
                            drop_console: true, //console
                            drop_debugger: false,
                            pure_funcs: ['console.log'] //移除console
                        },
                        compress: {
                            // 去除所有 console.log
                            drop_console: true,
                        },
                    },
                }),
            ],
        },
    },
    lintOnSave: false,
    chainWebpack: (config) => {
        config.plugin("html").tap((args) => {
            args[0].title = "祝融奖赛事管理系统";
            return args;
        });
    },
})
